using System;
using Sedna.Domain;
using Sedna.Domain.Orders;

namespace Sedna.API.Wrapper
{
    [Serializable]
    public class InventoryOrderLineWrapper
    {
        protected string commodityCode;
        protected string commodityClass;
        protected long quantity = 1;
        protected Weight weight = Weight.ZERO;

        # region constructors

        public InventoryOrderLineWrapper(InventoryOrderLine line)
        {
            commodityClass = line.Commodity.CommodityClass.ToString();
            commodityCode = line.Commodity.Code;
            weight = line.Weight;

            if (line is BulkOrderLine)
                quantity = ((BulkOrderLine)line).Quantity;
        }

        # endregion

        # region properties

        public string CommodityCode
        {
            get { return commodityCode; }
        }

        public string CommodityClass
        {
            get { return commodityClass; }
        }

        public long Quantity
        {
            get { return quantity; }
        }

        public Weight Weight
        {
            get { return weight; }
        }

        # endregion
    }
}
